package com.leantech.android.browser.ui.search

import android.os.Bundle
import android.view.View
import com.leantech.android.browser.R
import com.leantech.android.browser.databinding.ActivityCustomSearchEngineBinding
import com.leantech.android.browser.ui.BaseActivity
import com.leantech.android.browser.utils.onThrottleClick
import com.leantech.android.browser.utils.toast
import org.koin.core.component.KoinComponent
import org.koin.core.component.inject

class CustomSearchEngineActivity : BaseActivity(), KoinComponent {

    private lateinit var binding: ActivityCustomSearchEngineBinding

    private val viewModel by inject<CustomSearchEngineViewModel>()

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = ActivityCustomSearchEngineBinding.inflate(layoutInflater)
        setContentView(binding.root)

        initView()
    }

    private fun initView() {
        binding.topBar.apply {
            setTitle(R.string.text_custom_search_engine)
            addLeftBackImageButton().onThrottleClick {
                finish()
            }

            addRightTextButton(R.string.text_add, View.generateViewId()).onThrottleClick {
                toast("添加")
            }
        }


    }


}